#include "xil_io.h"
#include "gpio.h"



void SetGpioReg(unsigned int addrBase,unsigned int addrOffset,unsigned int value)
{
	Xil_Out32(addrBase+addrOffset, value);
}

int GetGpioReg(unsigned int addrBase,unsigned int addrOffset)
{
	int ans=0;
	ans=Xil_In32(addrBase+addrOffset);
	return ans;
}

unsigned int reverse_bit(unsigned int n,int length)
{
	int i=0;
	unsigned int ret=0;
	for(i=0;i<length;i++)
	{
		ret<<=1;
		ret|=(n>>i)&1;
	}
	return ret;
}
